/********************************************************************************
 * Copyright(c) 2020-2025 VINCENT_WY All rights reserved.
 * - Filename
 * - Author  Vincent
 * - Version V1.0.0
 * - Date    2023/02/16
 * - Brief
 * - FunctionList:
 ******************************************************************************
 * History:
 *
 *
 *
 ******************************************************************************
 */
#pragma once
#include <arpa/inet.h>
#include <deque>
#include <functional>
#include <iostream>
#include <memory>
#include <list>
#include <mutex>
#include <netdb.h>
#include <netinet/in.h>
#include <string>
#include <sys/socket.h>
#include <sys/types.h>
#include <thread>
#include <unistd.h>

/* parma define describe -----------------------------------------------------*/
/* class describe -----------------------------------------------------*/
namespace vudp {
class vudpClient {
public:
  vudpClient(const int &port);
  ~vudpClient();
  void vudpClientStart();
  void responseCallback(std::function<void(std::string &)> response_callbacl);

private:
private:
  void udpClientReciveLoop();
  std::function<void(std::string &)> responseCallBack{nullptr};
  std::shared_ptr<std::thread> _udpClientReciveThread;
  bool _isExit{false};
  int _listenPort{9000};
  int _udpFd{-1};
};
} // namespace vudp

/************************ (.h) END OF FILE ************************************/